package com.wanxin.wb.common.freemaker;

import java.util.Locale;

import org.apache.commons.lang3.StringUtils;
import org.springframework.web.servlet.View;
import org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver;

public class MutiLanguageFreeMarkerViewResolver  extends FreeMarkerViewResolver {
	
	
	/**
	 * 多语言支持
	 */
	@Override
	protected View createView(String viewName, Locale locale) throws Exception {
		
	    String url="";
	    String country=  locale.getCountry();
	    String lan=  locale.getLanguage();
	    
      if(StringUtils.isNotBlank(country)&&StringUtils.isNotBlank(lan)){
    	  System.out.println(">>>country=="+country);
   	     System.out.println(">>>lan=="+lan);
       }
    
	  
	    viewName=country+"/"+lan+"/"+viewName;
	    
	    
		return super.createView(viewName, locale);
	}
}
